--[[
	打开银行，用于验证密码
]]
local filename = "openbank.lua"

local timetool = require "timetool"
local skynet = require "skynet"
local cluster = require "skynet.cluster"
local filelog =require "filelog"
local md5 = require "md5"

local service = nil
local CMD = {
	service = nil
}

function CMD.process(rid, msgbody)
	if not service then
		service = CMD.service
	end

	if not msgbody.bankpwd or not service.money.lock_password or service.money.lock_password == "" then
		return {retcode = EErrCode.ERR_INVALID_PASSWORD, retstr = "密码错误！"}
	end
	local key = rid or service.rid or 0
	local lock_password = md5.sumhexa(msgbody.bankpwd .. key)
	if lock_password ~= service.money.lock_password then
		return {retcode = EErrCode.ERR_INVALID_PASSWORD, retstr = "密码错误！"}
	end
	
	return {}
end

return CMD